package com.saunter.utils.response;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

public class ErrorResponse extends Response {
    private String msg;
    private Object data;
    protected ErrorResponse(String code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }
    public Map<String, Object> toResponse(){
        Map<String, Object> response = new HashMap<String, Object>();
        response.put("s", this.code);
        response.put("m", this.msg);
        if(null != this.data) {
            response.put("d", this.data);
        }
        return response;
    }
}
